package com.dzsw.javabase.date;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.stream.Collectors;

public class DateSample {

    public static void main(String[] args) throws ParseException {
        String s = "1622995200000";
        var d = new Date(Long.valueOf(s));
        System.out.println(d);

//        Object[] objs = null;
//        objs = Arrays.stream(objs).map(obj -> obj.toString()).toArray(Object[]::new);
//        System.out.println(objs.length);


        String str = "1970-01-01 08:00:00";
        Calendar calendar = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        d = sdf.parse(str);
        System.out.println(sdf.format(d));
        System.out.println(d.getTime());
    }
}
